package cn.cttic.link.api.enums;

import cn.cttic.common.core.exception.link.LinkException;
import lombok.Getter;

@Getter
public enum ThirdInterfaceType {

    DISTRIBUTE_CHECK_TERMINAL("检测终端信息", "DISTRIBUTE_CHECK_TERMINAL"),
    DISTRIBUTE_REGISTER_TERMINAL("终端注册", "DISTRIBUTE_REGISTER_TERMINAL"),
    DISTRIBUTE_QUERY_TERMINAL("查询终端", "DISTRIBUTE_QUERY_TERMINAL"),
    DISTRIBUTE_TAKEUP_TERMINAL("终端占用", "DISTRIBUTE_TAKEUP_TERMINAL"),
    DISTRIBUTE_RELEASE_TERMINAL("释放终端", "DISTRIBUTE_RELEASE_TERMINAL"),

    MAPGOO_SYNC_TERMINAL_DATA("设备终端数据同步接口", "MAPGOO_SYNC_TERMINAL_DATA"),
    MAPGOO_QUERY_TERMINAL_REGISTER("查询终端注册结果", "MAPGOO_QUERY_TERMINAL_REGISTER"),
    MAPGOO_QUERY_TERMINAL_POSITION("查询最新轨迹", "MAPGOO_QUERY_TERMINAL_POSITION"),
    MAPGOO_SYNC_TERMINAL_FILING("同步备案数据", "MAPGOO_SYNC_TERMINAL_FILING"),
    MAPGOO_QUERY_TERMINAL_ACTIVE("查询设备激活", "MAPGOO_QUERY_TERMINAL_ACTIVE"),
    ;

    private final String label;
    private final String value;

    ThirdInterfaceType(String label, String value) {
        this.label = label;
        this.value = value;
    }

    public static ThirdInterfaceType of(String value) {
        for (ThirdInterfaceType type : ThirdInterfaceType.values()) {
            if (type.value == value) {
                return type;
            }
        }
        throw new LinkException("订单状态类型未匹配");
    }
}
